<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>   
<%@ taglib prefix="fmt" 
           uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ page isELIgnored="false" %>
<title>Pop up Accueil</title>
</head>
<body>
	<c:url var="logoutUrl" value="/j_spring_security_logout" />
	<div id="userConnectedProfile">
			<img src="${avatar}" alt="" />
			<div id="userInfo">
				<p>Bienvenue ${utilisateur.firstName} ${utilisateur.lastName}</p>
				<p class="optionsUserInfo"><a href="<%=request.getContextPath()%>/utilisateur/edit">Modifier mon profil</a></p>
				<p><a href="${logoutUrl}">Déconnexion</a></p>
			</div>
	</div>
	
	<h2>Agenda Groupes</h2>
	<div id="decoAgendaGroupe">
		<img src="${pageContext.request.contextPath}/resources/img/calendrier.jpg" alt=""/>
	<ul>
	<c:forEach items="${currentAgendaGroupes}" var="item">						    		
		<a href="<%=request.getContextPath()%>/agenda/evenement/${item.id}"><li><span class="titreEvent"><c:out value="${item.titre}"/></span> <fmt:formatDate value="${item.dateExpiration}" pattern="dd-MMM-yyyy" /></li></a>
	</c:forEach>	
	</ul>
	<c:if test="${!empty currentAgendaPerso}">
	<h2>Agenda Perso</h2>
	<div id="decoAgendaPerso">
	<ul>
	<c:forEach items="${currentAgendaPerso}" var="item">						    		
		<a href="<%=request.getContextPath()%>/agenda/evenement/perso/${item.id}"><li><span class="titreEvent"><c:out value="${item.titre}"/></span> <fmt:formatDate value="${item.dateExpiration}" pattern="dd-MMM-yyyy" /></li></a>
	</c:forEach>	
	</ul>
	</div>
	</c:if>
</body>
</html>